/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package exemple;

import exemple.HistoricSystem;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author PC
 */
@Entity
@Table(name="ADDRESS_IP")
public class AddressIp implements java.io.Serializable {
    private static final long serialVersionUID = -8667337896773261247L;
 
    private int id_address;
    private String name_hardware;
    private String address ;
    private String netmask;
    private String type_address;
    private Set<HistoricSystem> historics_system;

    public AddressIp() {
    }
    
    public AddressIp(int id_address, String name_hardware, String address, String netmask, String type_address){
        this.id_address = id_address;
        this.name_hardware = name_hardware;
        this.address = address;
        this.netmask = netmask;
        this.type_address = type_address;
    }
 
    @Id
    @GeneratedValue
    @Column(name="ID_ADDRESS")
    public int getId_address() {
        return id_address;
    }
    
    @Column(name="NAME_HARDWARE")
    public String getName_hardware() {
        return name_hardware;
    }
 
    @Column(name="ADDRESS")
    public String getAddress() {
        return address;
    }
  
     @Column(name="NETMASK")
    public String getNetmask() {
        return netmask;
    }
    
    @Column(name="TYPE_ADDRESS")
    public String getType_address() {
        return type_address;
    }

    public void setId_address(int id_address) {
        this.id_address = id_address;
    }  

    public void setName_hardware(String name_hardware) {
        this.name_hardware = name_hardware;
    }

    public void setAddress(String address) {
        this.address = address;
    }
    
    public void setNetmask(String netmask) {
        this.netmask = netmask;
    }

    public void setType_address(String type_address) {
        this.type_address = type_address;
    }
    
    @OneToMany(mappedBy="address")
    public Set<HistoricSystem> getHistorics_system() {
        return historics_system;
    }

    public void setHistorics_system(Set<HistoricSystem> historics_system) {
        this.historics_system = historics_system;
    }  

    @Override
    public String toString() {
        return "AddressIp{" + "id_address=" + id_address + ", name_hardware=" + name_hardware + ", address=" + address + ", netmask=" + netmask + ", type_address=" + type_address + '}';
    }
}
